﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class MessageBox : MonoBehaviour {

	// Use this for initialization
    public float m_fIsAutoClose { get; set; }
    public MsgBox m_MBquestion;
    public UnityEngine.UI.Text m_tBtn;
	void Start () {
        //gameObject.SetActive(false);
	}
	
	// Update is called once per frame
	void Update () {

        if (m_MBquestion.fIsAutoClose > 0)
        {
            //GameData.logger("m_fIsAutoClose:" + m_fIsAutoClose, 1);
            m_MBquestion.fIsAutoClose -= Time.deltaTime;
            m_tBtn.text = m_MBquestion.sBtnText + "(" + (int)m_MBquestion.fIsAutoClose + ")";
        }
        else
        {
            onClick();
        }
        
	}

    public void onClick()
    {
        gameObject.SetActive(false);
        GameData.gi.bIsGameRunning = true;
    }
}
